package com.apache.attachment.mommon;

import com.apache.attachment.entity.AttachmentStore;

public class AttachmentUtil {
	private static String urlDeal(String url) {
		return url.replace("\\", "/");
	}

	public static String getAttachUrl(AttachmentStore Attachment, String ty) throws Exception {
		StringBuffer url = new StringBuffer();
		String Attachmentdre = urlDeal(Attachment.getDownloadUrl());
		url.append(Attachmentdre).append(Attachment.getSid()).append(ty).append(Attachment.getAttachmentType());
		return url.toString();
	}

	public static String getDefaultAurl(AttachmentStore Attachment) throws Exception {
		return getAttachUrl(Attachment, ".");
	}
}